/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ceu
 */
@Entity
@Table(name = "status")
@NamedQueries({
    @NamedQuery(name = "Status.findAll", query = "SELECT s FROM Status s")})
public class Status implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private Integer idStatus;
    @Size(max = 45)
    private String name;
    @Size(max = 45)
    private String description;
     

    public Status() {
    }

    public Status(String name, String description) {
        this.name = name;
        this.description = description;
    }
    
    

    @TableGenerator(
        name="statusGen",
        table="JPA_WXS_APP_SEQUENCE_GENERATOR",
        pkColumnName="GEN_KEY",
        valueColumnName="GEN_VALUE",
        pkColumnValue="idStatus",
        allocationSize=1,
        initialValue=0)
        @Id
    @GeneratedValue(strategy=GenerationType.TABLE,generator="statusGen")
     @Column(name = "idStatus", nullable = false)
    public Integer getIdStatus() {
        return idStatus;
    }

    public void setIdStatus(Integer idstatus) {
        this.idStatus = idstatus;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }



    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idStatus != null ? idStatus.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Status)) {
            return false;
        }
        Status other = (Status) object;
        if ((this.idStatus == null && other.idStatus != null) || (this.idStatus != null && !this.idStatus.equals(other.idStatus))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistence.Status[ idstatus=" + idStatus + " ]";
    }
    
}
